<!--
 * @Descripttion:
 * @version:
 * @Author: 周子尧
 * @Date: 2021-02-07 10:09:24
 * @LastEditors: 周子尧
 * @LastEditTime: 2021-02-07 13:25:36
-->
<template>
  <div class="iframe-container">
    <iframe id="iframe" ref="iframe" :src="link" frameborder="no" border="0" marginwidth="0" marginheight="0" allowtransparency="yes" width="100%" height="100%" />
  </div>
</template>
<script>
import { decode } from '@/utils'
export default {
  name: 'TagLink',
  data() {
    return {
      link: '',
      loading: true
    }
  },
  created() {
    this.link = decode(this.$route.query.path)
    if (this.$route.query.$tagname) {
      document.title = this.$route.query.$tagname
    }
    if (!this.link) {
      this.$router.push({ path: '/404', replace: true })
    }
  },
  mounted: function() {
    const that = this
    var iframe = that.$refs.iframe
    iframe.onload = function() {
      that.loading = false
    }
  }
}
</script>
<style scoped>
.iframe-container{
    width: 100%;
    height: calc(100vh - 70px);
}
</style>
